import request from '@/utils/request'
import { exportFileByUrl, GetParams } from "@/utils/common.js";
 
// 投资人管理
// 投标信息数据库
export function getBidinfoData(params) {
  return request({
    url: 'budms/investor/bidinfo',
    method: 'get',
    params
  }) 
}
export function getBidinfoDataDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/bidinfo${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 团体投资人
export function getAnalysisMemberData(params) {
  return request({
    url: 'budms/investor/analysis/member',
    method: 'get',
    params
  }) 
}
export function getAnalysisMemberDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/member${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function getAnalysisMemberListData(params) {
  return request({
    url: 'budms/investor/analysis/member/list',
    method: 'get',
    params
  })
}
export function getAnalysisMemberListDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/member/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 主承债直接投资人
export function getAnalysisUnderwritingbondData(params) {
  return request({
    url: 'budms/investor/analysis/underwritingbond',
    method: 'get',
    params
  })
}
export function getAnalysisUnderwritingbondDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/underwritingbond${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function getAnalysisUnderwritingbondListData(params) {
  return request({
    url: 'budms/investor/analysis/underwritingbond/list',
    method: 'get',
    params
  })
}
export function getAnalysisUnderwritingbondListDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/underwritingbond/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 分销债投资人
export function getAnalysisDistributionData(params) {
  return request({
    url: 'budms/investor/analysis/distribution',
    method: 'get',
    params
  })
} 
export function getAnalysisDistributionDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/distribution${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function getAnalysisDistributionListData(params) {
  return request({
    url: 'budms/investor/analysis/distribution/list',
    method: 'get',
    params
  })
}
export function getAnalysisDistributionListDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/distribution/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 债承承销专户投资人
export function getAnalysisUnderwritingData(params) {
  return request({
    url: 'budms/investor/analysis/underwriting',
    method: 'get',
    params
  })
}
export function getAnalysisUnderwritingDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/underwriting${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function getAnalysisUnderwritingListData(params) {
  return request({
    url: 'budms/investor/analysis/underwriting/list',
    method: 'get',
    params
  })
}
export function getAnalysisUnderwritingListDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/underwriting/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 自营/理财投资人
export function getAnalysisSofmData(params) {
  return request({
    url: 'budms/investor/analysis/sofm',
    method: 'get',
    params
  })
}
export function getAnalysisSofmDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/sofm${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function getAnalysisSofmListData(params) {
  return request({
    url: 'budms/investor/analysis/sofm/list',
    method: 'get',
    params
  })
}
export function getAnalysisSofmListDataDownloadUrl( params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/investor/analysis/sofm/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}